import time
from concurrent.futures import ThreadPoolExecutor


def func(name: str):
    print(f"{name} - step - 1\n", end="")
    time.sleep(1)
    print(f"{name} - step - 2\n", end="")

    return f"{name} - done"


# with ThreadPoolExecutor() as executor:
#     result1 = executor.submit(func, "thread-1")
#     result2 = executor.submit(func, "thread-2")
#
#     print(result1.result())
#     print(result2.result())

with ThreadPoolExecutor() as executor:
    result = executor.map(func, ["thread-1", "thread-2"])

    for res in result:
        print(res)
